Normalize hyphens to underscores in crate names
authorAlex Crichton <alex@alexcrichton.com>
Fri, 20 Mar 2015 20:40:27 +0000 (13:40 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 25 Mar 2015 02:30:02 +0000 (19:30 -0700)
commitafe88e0bd1b665c4344a1af2c58edc94314fdb8a
tree3dd59c988880bbe946c8f35b1253269d16d304ce
parent0d878de3f65e8a5c439b7ae46a38db3527a4834d
Normalize hyphens to underscores in crate names

This change allows *packages* to have hyphens in them, but they are always
translated to underscores when translated to a crate name. This means that all
crates are compiled with a `--crate-name` that has no hyphens (as well as
`--extern` directives having no hyphens).

Binaries, examples, benchmarks, and tests, however, are allowed to contain
hyphens in their name. The "crate name" will still have an underscore, but the
output will be in the same dasherized name.

Explicitly named targets are not allowed to have hyphens in them as well.
src/cargo/core/manifest.rs
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/mod.rs
src/cargo/util/toml.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_custom_build.rs